package c17网络编程;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;

public class TestURLDecodeEncode {

	public static void main(String[] args) throws UnsupportedEncodingException {
		//application/x-www-form-urlencoded MIME字符串
		String mime = "%E8%8D%89%E6%B3%A5%E9%A9%AC";
		//解码成普通字符串
		System.err.println(URLDecoder.decode(mime, "UTF-8"));

		String s = "我去年买了个表";
		//编码成...
		System.err.println(URLEncoder.encode(s, "UTF-8"));
	}

}
